package com.gxuwz.zlc.service.impl;

import com.gxuwz.zlc.entity.Department;
import com.gxuwz.zlc.mapper.DepartmentMapper;
import com.gxuwz.zlc.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentServiceImpl implements DepartmentService {

    @Autowired
    private DepartmentMapper departmentMapper;

    @Override
    public List<Department> findDepartment() {
        return departmentMapper.selectList(null);
    }

    @Override
    public Department findDepartmentById(String deptId) {
        return departmentMapper.selectById(deptId);
    }

    @Override
    public void addDepartment(Department department) {
        departmentMapper.insert(department);
    }

    @Override
    public void updateDepartment(Department department) {
        departmentMapper.updateById(department);
    }

    @Override
    public void deleteDepartment(String deptId) {
        departmentMapper.deleteById(deptId);
    }
}
